package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1ItemInstance;

public class S_ItemName extends ServerBasePacket {
  private byte[] _byte;
  
  public S_ItemName(L1ItemInstance item) {
    this._byte = null;
    if (item == null)
      return; 
    writeC(100);
    writeD(item.getId());
    writeS(item.getViewName());
  }
  
  public S_ItemName(L1ItemInstance item, int id) {
    this._byte = null;
    if (item == null)
      return; 
    writeC(100);
    writeD(item.getId());
    writeS(String.valueOf(String.valueOf(item.getViewName())) + " ($" + id + ")");
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
